﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using MediatR;
using Microsoft.AspNetCore.Mvc;
using MyTask.Domain.Commands;
using MyTask.Tasking.Applicaiton.Commands;

namespace MyTask.Tasking.API.Controllers
{
    [Route("api/task")]
    [ApiController]
    public class TaskInfoController : ControllerBase
    {
        IMediator _mediator;
        public TaskInfoController(IMediator mediator)
        {
            _mediator = mediator;
        }

        [Route("create")]
        [HttpPost]
        public async Task<bool> CreateTaskAsync(CreatedTaskInfoCommand command)
        {
            return await _mediator.Send(command, HttpContext.RequestAborted);
        }

    }
}